@extends('Home.User.Common.layout')
@section('title')
    首页_用户
@endsection
@section('content')
    <style>
        .navContent{display: none;}
    </style>
    <!--  content  -->
    <main class="common_content">
        <div class="container">
            <div class="ct_main">
                @include('Home.User.Common.index_menu')
                <ul class="nav-items1" id="tab-content1">
                    <li class="zhuomian active">
                        <div class="zhuomian-f1">
                            <p class="p">欢迎您：</p>
                            <div class="welcome-name">
                                <span class="mg-rt10">{{$user->username}}</span>@if($user->duties) | <span class="mg-lt10">{{$user->duties}}</span>@endif
                            </div>
                            <p class="p">所属部门：<span>{{$user->branch_name}}</span></p>
                            <div class="tb-lis1 flex-sbtc">
                                <p class="fp">登录次数：<span>{{$user->login_count}}</span>次</p>
                                <p class="fp">最后登录时间：<span>{{$user->last_login_time}}</span></p>
                                <p class="fp" style="text-align: right;">最后登录地址：<span>{{$user->last_login_address}}</span></p>
                            </div>
                            <div class="tb-ul">
                                <h4>我的统计(总数)：</h4>
                                <div class="tb-lis2 flex-sbtw">
                                    <p class="fp"> 客户 ( <span>{{$history_data['client_count']}}</span> ) </p>
                                    <p class="fp"> 简历 ( <span>{{$history_data['resume_count']}}</span> ) </p>
                                    <p class="fp"> 推荐面试 ( <span>{{$history_data['2count']}}</span> ) </p>
                                    <p class="fp" title="推荐一面简历数"> 一面 ( <span>{{$history_data['4count']}}</span> ) </p>
                                    <p class="fp" title="推荐二面简历数"> 二面 ( <span>{{$history_data['6count']}}</span> ) </p>
                                    <p class="fp"> 面试通过 ( <span>{{$history_data['8count']}}</span> ) </p>
                                    <p class="fp"> offer成功 ( <span>{{$history_data['10count']}}</span> ) </p>
                                    <p class="fp"> 入职 ( <span>{{$history_data['13count']}}</span> ) </p>
                                </div>
                            </div>
                        </div>
                        <div class="zhuomian-f2">
                            <ul>
                                @if(!in_array(Auth::user()->type,[2,3]))
                                <li>
                                    <div class="zm-title subNav current"><b>知识分享</b> <i class="icon icon-up"></i></div>
                                    <table class="layui-table navContent" style="margin: 0px; display: table;">
                                        <colgroup>
                                            <col width="60">
                                            <col width="220">
                                            <col>
                                            <col width="180">
                                        </colgroup>
                                        <thead>
                                        <tr>
                                            <th>编号</th>
                                            <th>标题</th>
                                            <th>内容</th>
                                            <th>创建时间</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($knowledge as $item)
                                            <tr>
                                                <td>{{$item->id}}</td>
                                                <td><a href="javascript:;" onclick="open_button('{{route('knowledge_detail',$item->id)}}','知识分享详情','800','500')">{{$item->title}}</a></td>
                                                <td><a href="javascript:;" onclick="open_button('{{route('knowledge_detail',$item->id)}}','知识分享详情','800','500')">{{ str_limit($item->content, 20, '... ...') }}</a></td>
                                                <td>{{$item->updated_at}}</td>
                                            </tr>
                                        @endforeach
                                        </tbody>
                                    </table>
                                </li>
                                @endif
                                    <li>
                                        <div class="zm-title subNav current"><b>新上传简历未推荐（3天）</b> <i class="icon icon-up"></i></div>
                                        <table class="layui-table navContent" style="margin: 0px; display: table;">
                                            <colgroup>
                                                <col width="60">
                                                <col>
                                                <col>
                                                <col>
                                                <col>
                                                <col width="">
                                            </colgroup>
                                            <thead>
                                            <tr>
                                                <th>编号</th>
                                                <th>上传时间</th>
                                                <th>姓名</th>
                                                <th>求职职位</th>
                                                <th>工作年限</th>
                                                <th>简历来源</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            @foreach($get_resume_three as $item)
                                                <tr>
                                                    <td>{{$item['id']}}</td>
                                                    <td>{{$item['created_at']}}</td>
                                                    <td>{{$item['name'] }}</td>
                                                    <td>{{$item['position']}}</td>
                                                    <td>{{$item['experience']}}</td>
                                                    <td>{{$item['source']}}</td>
                                                </tr>
                                            @endforeach
                                            </tbody>
                                        </table>
                                    </li>
                                    {{--<li>--}}
                                        {{--<div class="zm-title subNav"><b>待推荐</b> <i class="icon icon-up"></i></div>--}}
                                        {{--<table class="layui-table navContent" style="margin: 0px; display: table;">--}}
                                            {{--<colgroup>--}}
                                                {{--<col width="200">--}}
                                                {{--<col>--}}
                                                {{--<col>--}}
                                                {{--<col>--}}
                                                {{--<col>--}}
                                                {{--<col>--}}
                                            {{--</colgroup>--}}
                                            {{--<thead>--}}
                                            {{--<tr>--}}
                                                {{--<th>推荐时间</th>--}}
                                                {{--<th>推荐客户</th>--}}
                                                {{--<th>职位</th>--}}
                                                {{--<th>候选人</th>--}}
                                                {{--<th>当前状态</th>--}}
                                                {{--<th>推荐人</th>--}}
                                            {{--</tr>--}}
                                            {{--</thead>--}}
                                            {{--<tbody>--}}
                                            {{--@if($schedule_list[1])--}}
                                                {{--@foreach($schedule_list[1] as $item)--}}
                                                    {{--<tr>--}}
                                                        {{--<td>{{$item->push_time}}</td>--}}
                                                        {{--<td>{{$item->client_name}}</td>--}}
                                                        {{--<td>{{$item->position_name}}</td>--}}
                                                        {{--<td>{{$item->resume_name}}</td>--}}
                                                        {{--<td>{{$item->result_name}}</td>--}}
                                                        {{--<td>{{$item->assign_name}}</td>--}}
                                                    {{--</tr>--}}
                                                {{--@endforeach--}}
                                            {{--@endif--}}
                                            {{--</tbody>--}}
                                        {{--</table>--}}
                                    {{--</li>--}}
                                    <li>
                                        <div class="zm-title subNav"><b>已推荐</b> <i class="icon icon-up"></i></div>
                                        <table class="layui-table navContent" style="margin: 0px; display: table;">
                                            <colgroup>
                                                <col width="200">
                                                <col>
                                                <col>
                                                <col>
                                                <col>
                                                <col>
                                            </colgroup>
                                            <thead>
                                            <tr>
                                                <th>推荐时间</th>
                                                <th>推荐客户</th>
                                                <th>职位</th>
                                                <th>候选人</th>
                                                <th>当前状态</th>
                                                <th>推荐人</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            @if($schedule_list[2])
                                                @foreach($schedule_list[2] as $item)
                                                    <tr>
                                                        <td>{{$item->push_time}}</td>
                                                        <td>{{$item->client_name}}</td>
                                                        <td>{{$item->position_name}}</td>
                                                        <td>{{$item->resume_name}}</td>
                                                        <td>{{$item->result_name}}</td>
                                                        <td>{{$item->assign_name}}</td>
                                                    </tr>
                                                @endforeach
                                            @endif
                                            </tbody>
                                        </table>
                                    </li>
                                <li>
                                    <div class="zm-title subNav"><b>面试中</b> <i class="icon icon-up"></i></div>
                                    <table class="layui-table navContent" style="margin: 0px; display: table;">
                                        <colgroup>
                                            <col width="200">
                                            <col>
                                            <col>
                                            <col>
                                            <col>
                                            <col>
                                        </colgroup>
                                        <thead>
                                        <tr>
                                            <th>推荐时间</th>
                                            <th>推荐客户</th>
                                            <th>职位</th>
                                            <th>候选人</th>
                                            <th>当前状态</th>
                                            <th>推荐人</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @if($schedule_list[4])
                                            @foreach($schedule_list[4] as $item)
                                                <tr>
                                                    <td>{{$item->push_time}}</td>
                                                    <td>{{$item->client_name}}</td>
                                                    <td>{{$item->position_name}}</td>
                                                    <td>{{$item->resume_name}}</td>
                                                    <td>{{$item->result_name}}</td>
                                                    <td>{{$item->assign_name}}</td>
                                                </tr>
                                            @endforeach
                                        @endif
                                        @if($schedule_list[6])
                                            @foreach($schedule_list[6] as $item)
                                                <tr>
                                                    <td>{{$item->push_time}}</td>
                                                    <td>{{$item->client_name}}</td>
                                                    <td>{{$item->position_name}}</td>
                                                    <td>{{$item->resume_name}}</td>
                                                    <td>{{$item->result_name}}</td>
                                                    <td>{{$item->assign_name}}</td>
                                                </tr>
                                            @endforeach
                                        @endif
                                        </tbody>
                                    </table>
                                </li>
                                <li>
                                    <div class="zm-title subNav"><b>待入职</b> <i class="icon icon-up"></i></div>
                                    <table class="layui-table navContent" style="margin: 0px; display: table;">
                                        <colgroup>
                                            <col width="200">
                                            <col>
                                            <col>
                                            <col>
                                            <col>
                                            <col>
                                        </colgroup>
                                        <thead>
                                        <tr>
                                            <th>推荐时间</th>
                                            <th>推荐客户</th>
                                            <th>职位</th>
                                            <th>候选人</th>
                                            <th>当前状态</th>
                                            <th>推荐人</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @if($schedule_list[12])
                                            @foreach($schedule_list[12] as $item)
                                                <tr>
                                                    <td>{{$item->push_time}}</td>
                                                    <td>{{$item->client_name}}</td>
                                                    <td>{{$item->position_name}}</td>
                                                    <td>{{$item->resume_name}}</td>
                                                    <td>{{$item->result_name}}</td>
                                                    <td>{{$item->assign_name}}</td>
                                                </tr>
                                            @endforeach
                                        @endif
                                        </tbody>
                                    </table>
                                </li>
                            </ul>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="ct_right">
                <ul class="cr-list">
                    @if(!in_array(Auth::user()->type,[2,3]))
                        <li>
                            <div class="zm-title"><b>公告&通知</b> <i class="icon icon-fenlei"></i></div>
                            <ul class="cr-ul">
                                @foreach($notice as $item)
                                    <li>
                                        <a href="javascript:;" class="txt-ellipsis-3" onclick="open_button('{{route('notice_detail',$item->id)}}','通知详情','800','400')">{{$item->title}}</a></a>
                                        <p class="pub-info"><span>{{$item->user_name}}</span><span>{{$item->updated_at}}</span></p>
                                    </li>
                                @endforeach
                            </ul>
                        </li>
                    @endif
                    <li>
                        <div class="zm-title"><b>本月业绩</b> <i class="icon icon-fenlei"></i></div>
                        <div class="tb-lis2">
                            <p class="fp"> 上传简历 ( <span>{{$month_data['resume_count']}}</span> ) </p>
                            <p class="fp"> 推荐面试 ( <span>{{$month_data['2count']}}</span> ) </p>
                            <p class="fp"> 面试通过 ( <span>{{$month_data['8count']}}</span> ) </p>
                            <p class="fp"> offer成功 ( <span>{{$month_data['10count']}}</span> ) </p>
                            <p class="fp"> 成功入职 ( <span>{{$month_data['13count']}}</span> ) </p>
                            <p class="fp"> 回款金额 ( <span>{{$month_data['receipts']}}</span> ) </p>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </main>

@endsection
@section('footer')
    <script src="{{ asset('js/jQueryRotate.2.2.js') }}"></script>
    <script>
        layui.use('element', function(){
            var element = layui.element;
        });
        /***** 导航条 JS *****/
        $(function(){
            $('.lt_nav').on('click', 'li', function () {
                let n = $(this).index();
                $('.lt_nav li').removeClass('active').eq(n).addClass('active');
            });
        });

        /********  toggle nav  *******/
        $(function(){
                $(".subNav").click(function(){
                    var rotate = parseInt($(this).find(".icon-up").attr('rotate'));
                    if (!rotate) {
                        rotate = 0;
                    }
                    rotate += 180;
                    $(this).find(".icon-up").attr('rotate',rotate).rotate(rotate);
                    $(this).toggleClass("current").siblings(".subNav").removeClass("current");
                    $(this).next(".navContent").slideToggle(300).siblings(".navContent").slideUp(500);
                })
        })

    </script>
@endsection